﻿//var DIALOG_BUTTON_OK = 1;
//var DIALOG_BUTTON_CANCEL = 2;
//var DIALOG_BUTTON_PREVIOUS = 4;
//var DIALOG_BUTTON_NEXT = 8;
//var DIALOG_BUTTON_CUSTOM = 16;
//var dialogMessages;


//// TODO ADD Captions for Custom

//function dialog(title, message, arrayMessage, src, width, height, buttons, customButtonText, customButtonFunction, topLeft) {
//    this.title = title;
//    // TODO: Test Variables
//    if (arrayMessage != null) {
//        this.message = arrayMessage[0];
//        if (arrayMessage.length > 1)
//            this.sequenceCount = arrayMessage.length;
//    }
//    else {
//        this.message = message;
//        this.sequenceCount = 0;
//    }

//    this.src = src; 
//    this.width = width;
//    this.height = height;
//    this.topLeft = topLeft;
//    this.buttons = buttons;
//    this.customButtonText = customButtonText;
//    this.customButtonFunction = customButtonFunction;
//    this.sndDialogStart = document.getElementById("sndDialogStart");
//    this.dialogVideo = document.getElementById("dialogVideo");

//    this.showWithAction = function (funcPointer) {
//        this.show();
//        funcPointer();
//    };


//    this.show = function () {
//        document.getElementById("dialogWrapper").style.zIndex = 500;

//        this.sndDialogStart.pause();
//        this.sndDialogStart.play();
//        if (src != null) {
//            dialogVideo.src = src;
//            dialogVideo.style.visibility = "visible";
//            dialogVideo.play();
//        }
//            else {
//                dialogVideo.style.visibility = "hidden";

//        }
//        var dialogElement = document.getElementById("dialogWrapper");
//        dialogElement.style.visibility = "visible";
//        dialogElement.style.height = (this.height - 20) + "px";
//        dialogElement.style.width = this.width + "px";
//        dialogElement.style.opacity = 1;
//        if (this.topLeft) {
//            dialogElement.style.left = "40px";
//            dialogElement.style.top = "40px";
//           
//        }
//            else {
//                centerElement(dialogElement);
//            }
//        document.getElementById("dialogTitle").innerHTML = this.title;
//        document.getElementById("dialogMessage").innerHTML = this.message;
//        if ((dialogMessage.customButtonFunction != undefined) || (this.customButtonFunction != null)) {
//            document.getElementById("btnDialog16").onclick = this.customButtonFunction;
//            document.getElementById("btnDialog16").innerHTML = this.customButtonText;
//        }
//        this.setButtons();
//    };


//    this.setButtons = function () {
//        for (var i = 0; i < 5; i++) {

//            // TODO : fix with if ? :
//            if ((this.buttons & Math.pow(2, i)) > 0)
//                document.getElementById("btnDialog" + Math.pow(2, i).toString()).style.display = "inline";
//            else
//                document.getElementById("btnDialog" + Math.pow(2, i).toString()).style.display = "none";

//        }
//    };

//    return this;

//}




//function btnCancel() {
//    closeDialog();
//}


//function dialogOK() {
////    dialogVideo.pause();
//    dialogVideo.style.visbility = "hidden";
//    dialogVideo.style.zIndex = 0;
//    document.getElementById("dialogWrapper").style.visibility = "hidden";
//    document.getElementById("dialogWrapper").style.opacity = 0;
//    document.getElementById("dialogWrapper").style.zIndex = 0;
//    document.getElementById("dialogWrapper").style.left = "-1000px";


//    this.animationRunning = false;
//    game.draw();
//}
